const mongoose = require('mongoose');

//创建文档结构对象 用来约束插入文档的结构
let BookSchema = new mongoose.Schema({
    name: String,
    author: String,
    price: Number,
    cbs: String,
    img: String,
    intro: String
});

//创建模型对象                  集合名称   结构对象
let BookModel = mongoose.model("books", BookSchema); 

//暴露对象
module.exports = BookModel;